package com.example.mybatisplusproject.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author zls
 * @date 2021/7/10 4:05 下午
 */
@Data
public class BaseEntity {
    @TableId(type = IdType.AUTO) // 设置主键自增
    private Long id;
    @TableField(value = "create_by",fill = FieldFill.INSERT)
    private String createBy;
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    // 使用LocalDateTime来保存时间类型，数据库选择timestamp类型  如果用Date类型可能会有问题
    private LocalDateTime createTime;
    @TableField(value = "update_by",fill = FieldFill.UPDATE)
    private String updateBy;
    @TableField(value = "update_time",fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;
    @TableLogic
    private Integer isDelete;
}
